import { defineStore } from "pinia";

import { theme } from "@/config/setting";
import type { TTheme } from "@/@types/config.setting";


export interface globalState {
    theme: TTheme
}

export const useGlobalStore = defineStore("useGlobalStore", {
  state: (): globalState => {
    return {
      theme: theme
    }
  },

  getters: {
    getTheme: (state) => state.theme
  },

  actions: {
    // 设置主题
    setTheme(theme: TTheme) {
      this.theme = theme
    }
  }
})